package at.horario.service.impl;

import at.horario.dao.UserDao;
import at.horario.model.User;
import at.horario.service.UserManager;

/**
 * Created by IntelliJ IDEA.
 * User: at
 * Date: 16/Set/2007
 * Time: 11:56:25
 * To change this template use File | Settings | File Templates.
 */
public class UserManagerImpl extends GenericManagerImpl<User, Long> implements UserManager {
    private UserDao userDao;

    public UserManagerImpl(final UserDao userDao) {
        super(userDao);
        this.userDao = userDao;
    }

    public boolean exists(String username) {
        return findByUsername(username) != null;
    }

    private User findByUsername(String username) {
        return userDao.findByUsername(username);
    }
}
